<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of getsubmissiondetails
 *
 * @author srkrishnan
 */

/**

 * @property CI_Loader $load

 * @property CI_Form_validation $form_validation

 * @property CI_Input $input

 * @property CI_Email $email

 * @property CI_DB_active_record $db

 * @property CI_DB_forge $dbforge
 * 
 * @property problem $problem 

 */
class Getsubmissiondetails extends CI_Controller {

    private $userid = "anantha89", $password = "myideone";
    
    function Getsubmissiondetails() {
        parent::__construct();
    }

    function index() {
        $link = trim($this->input->post('link'));

        try {
            //create new SoapClient
            $client = new SoapClient("http://ideone.com/api/1/service.wsdl");

            //finally get the submission results
            $details = $client->getSubmissionDetails($this->userid, $this->password, $link, true, true, true, true, true);


            $jsondetails = array(
                'details' => $details
            );
        } catch (Exception $e) {
            $jsondetails = array(
                'error' => $e
            );
        }
        $jsondetails = json_encode($jsondetails);
        echo $jsondetails;
    }

}

?>
